from django.contrib.auth.models import AbstractUser
from django.db import models


class CustomUser(AbstractUser):
    """自定义用户"""
    avatar = models.CharField(verbose_name='头像', max_length=500, blank=True, null=True, default='')
    mobile_phone = models.CharField(verbose_name='手机', max_length=15, blank=True, null=True, default='')
    real_name = models.CharField(verbose_name='真实姓名', blank=True, null=True, max_length=30, default='')
    sex = models.SmallIntegerField(verbose_name='性别', choices=((0, '男'), (1, '女')), default=0, blank=True)
    personal_signature = models.CharField(verbose_name='个性签名', max_length=500, blank=True, null=True, default='')

    class Meta:
        verbose_name = '用户'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username
